package com.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.common.dto.ArticleDTO;
import com.common.model.Article;
import com.common.query.ArticleQueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@Mapper
public interface ArticleMapper extends BaseMapper<Article> {

    Article findWithUserByArticleId(@Param("articleId") Long articleId);

    List<Article> selectAllByQueryParamPage(IPage<ArticleDTO> pagination, ArticleQueryParam article);

    List<Article> selectAllWithUser(@Param("article") ArticleQueryParam article);

    List<Map> getArticleArchives();
}
